package cn.ecut.service.impl;

import cn.ecut.dao.GuanliyuanDao;
import cn.ecut.model.Guanliyuan;
import cn.ecut.model.ShenqingdanMessage;
import cn.ecut.model.Yuangong;
import cn.ecut.service.GuanliyuanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;


@Service
public class GuanliyuanServiceimpl implements GuanliyuanService {

    @Autowired
    private GuanliyuanDao guanliyuanDao;

    @Override
    public String selectMimaByyonghuming(String yonghuming) {
        return guanliyuanDao.selectMimaByyonghuming(yonghuming);
    }

    @Override
    public String selectyonghumingBymima(String mima) {
        return guanliyuanDao.selectyonghumingBymima(mima);
    }

    @Override
    public int updateByyonghuming(Guanliyuan guanliyuan) {
        return guanliyuanDao.updateByyonghuming(guanliyuan);
    }

    @Override
    public int insertYuangong(Yuangong yuangong) {
        return guanliyuanDao.insertYuangong(yuangong);
    }

    @Override
    public Object getYuangongMessqge() {
        HashMap<String, Object> map = new HashMap<String, Object>();
        Integer count = guanliyuanDao.selectAllcount();
        List<Yuangong> list = new ArrayList();
        list=guanliyuanDao.selectAllyuangons();
        map.put("code", 0);
        map.put("msg", "");
        map.put("count", count);
        map.put("data", list);//dao层查询返回list数据
        return map;
    }

    @Override
    public int deleteYuangongByyangongHao(String yuangongHao) {
        return guanliyuanDao.deleteYuangongByyangongHao(yuangongHao);
    }

    @Override
    public List<Yuangong> advanceSelect(String s) {
        return guanliyuanDao.advanceSelect(s);
    }

    @Override
    public Integer updateAllByYuangongHao(Yuangong yuangong) {
        return guanliyuanDao.updateAllByYuangongHao(yuangong);
    }

    @Override
    public String selectmimaByyuangongHao(String yuangongHao) {
        return guanliyuanDao.selectmimaByyuangongHao(yuangongHao);
    }

}
